package kr.co.graviti.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import kr.co.graviti.common.application.MultipartUploadFileService;
import kr.co.graviti.common.model.MultipartUploadFile;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class GlobalController {
	
	private static final Logger logger = LoggerFactory.getLogger(GlobalController.class);

	@RequestMapping(value="/{path01}")
	public ModelAndView handleRequest(HttpServletRequest request
			, HttpServletResponse response
			, @PathVariable String path01) {
		
		logger.info("{path01}.daum");
				
		return new ModelAndView(new StringBuffer(path01).toString());
	}
	
	@RequestMapping(value="/{path01}/{path02}")
	public ModelAndView handleRequest(HttpServletRequest request
			, HttpServletResponse response
			, @PathVariable String path01
			, @PathVariable String path02) {
		
		logger.info("{path01}{path02}.daum");
				
		return new ModelAndView(new StringBuffer(path01)
			.append("/")
			.append(path02).toString());
	}
	
	@RequestMapping(value="/{path01}/{path02}/{path03}")
	public ModelAndView handleRequest(HttpServletRequest request
			, HttpServletResponse response
			, @PathVariable String path01
			, @PathVariable String path02
			, @PathVariable String path03) {
		
		logger.info("{path01}/{path02}/{path02}.daum");
				
		return new ModelAndView(new StringBuffer(path01)
			.append("/")
			.append(path02)
			.append("/")
			.append(path03).toString());
	}
	
	/*@RequestMapping(value="/WEB-INF/vm/include/left.vm")
	public ModelAndView handleRequest(HttpServletRequest request
			, HttpServletResponse response) {
		
		logger.info("=============================");
		logger.info("- left ");
		logger.info("=============================");
		
		return new ModelAndView(new String("include/left"));
	}*/

}

